package com.aaa.pay.controller;

import com.aaa.pay.service.AccountOrderALiService;
import com.aaa.vo.AccountOrderVo;
import com.aaa.vo.MqVo;
import com.aaa.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 崔灿
 * @Date 2023/03/06 17:04
 * @ClassName AccountOrderALiController
 * @Description
 * @Version 1.0
 */

@Api(value = "/pay/aliPay", tags = {"阿里付"})
@RestController
@RequestMapping("/pay/aliPay")
public class AccountOrderALiController {
    @Autowired
    private AccountOrderALiService accountOrderALiService;
    /**
     * #Description createNative 生成支付宝订单url
     * @param accountOrderVo
     * @return
     * @author 崔灿
     * #Date
     */

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "AccountOrderVo", name = "accountOrderVo", value = "", required = true)
    })
    @ApiOperation(value = "#Description createNative 生成支付宝订单url #Date", notes = "#Description createNative 生成支付宝订单url #Date", httpMethod = "POST")
    @PostMapping("/createNative1")
    public Result createNative(@RequestBody AccountOrderVo accountOrderVo){
        return accountOrderALiService.createNative(accountOrderVo);
    }
    /**
     * #Description createNative
     * @param accountOrderVo
     * @return
     * @author 崔灿
     * #Date
     */

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "AccountOrderVo", name = "accountOrderVo", value = "", required = true)
    })
    @ApiOperation(value = "#Description createNative #Date", notes = "#Description createNative #Date", httpMethod = "POST")
    @PostMapping("/createNative2")
    public Result createNative2(@RequestBody AccountOrderVo accountOrderVo){
        return accountOrderALiService.createNative2(accountOrderVo);
    }
/**
 * #Description queryPayStatus 修改订单状态
 * @param id
 * @return
 * @author 崔灿
 * #Date
 */

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "int", name = "id", value = "", required = true)
    })
    @ApiOperation(value = "#Description queryPayStatus 修改订单状态 #Date", notes = "#Description queryPayStatus 修改订单状态 #Date", httpMethod = "POST")
    @PostMapping("/queryPayStatus")
    public Result queryPayStatus(Integer id){
        return accountOrderALiService.queryPayStatus(id);
    }
    /**
     * #Description addMoney 充值成功修改余额
     * @param accountOrderVo
     * @return
     * @author 崔灿
     * #Date
     */

    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", dataType = "AccountOrderVo", name = "accountOrderVo", value = "", required = true)
    })
    @ApiOperation(value = "#Description addMoney 充值成功修改余额 #Date", notes = "#Description addMoney 充值成功修改余额 #Date", httpMethod = "POST")
    @PostMapping("/addMoney1")
    public Result addMoney(@RequestBody AccountOrderVo accountOrderVo){
        return accountOrderALiService.addMoney(accountOrderVo);
    }
    @PostMapping("/createMQ")
    public Result createMQ(@RequestBody MqVo mqVo){
        return accountOrderALiService.createMQ(mqVo.getId());
    }
}
